//
//	GDVerifyPhoneRoot.m
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "GDVerifyPhoneRoot.h"

NSString *const kGDVerifyPhoneRootToken = @"token";
NSString *const kGDVerifyPhoneRootUserInfo = @"userInfo";

@interface GDVerifyPhoneRoot ()
@end
@implementation GDVerifyPhoneRoot




/**
 * Instantiate the instance using the passed dictionary values to set the properties values
 */

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
	self = [super init];
	if(![dictionary[kGDVerifyPhoneRootToken] isKindOfClass:[NSNull class]]){
		self.token = dictionary[kGDVerifyPhoneRootToken];
	}	
	if(![dictionary[kGDVerifyPhoneRootUserInfo] isKindOfClass:[NSNull class]]){
		self.userInfo = [[GDUserInfo alloc] initWithDictionary:dictionary[kGDVerifyPhoneRootUserInfo]];
	}

	return self;
}


/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
	NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
	if(self.token != nil){
		dictionary[kGDVerifyPhoneRootToken] = self.token;
	}
	if(self.userInfo != nil){
		dictionary[kGDVerifyPhoneRootUserInfo] = [self.userInfo toDictionary];
	}
	return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
	if(self.token != nil){
		[aCoder encodeObject:self.token forKey:kGDVerifyPhoneRootToken];
	}
	if(self.userInfo != nil){
		[aCoder encodeObject:self.userInfo forKey:kGDVerifyPhoneRootUserInfo];
	}

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
	self = [super init];
	self.token = [aDecoder decodeObjectForKey:kGDVerifyPhoneRootToken];
	self.userInfo = [aDecoder decodeObjectForKey:kGDVerifyPhoneRootUserInfo];
	return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
	GDVerifyPhoneRoot *copy = [GDVerifyPhoneRoot new];

	copy.token = [self.token copy];
	copy.userInfo = [self.userInfo copy];

	return copy;
}
@end